package com.ruoyi.airspaceFlight.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.airspaceFlight.mapper.TInstitutionPersonDeviceMapper;
import com.ruoyi.airspaceFlight.domain.TInstitutionPersonDevice;
import com.ruoyi.airspaceFlight.service.ITInstitutionPersonDeviceService;

/**
 * 机构或个人持有设备信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-03
 */
@Service
public class TInstitutionPersonDeviceServiceImpl implements ITInstitutionPersonDeviceService 
{
    @Autowired
    private TInstitutionPersonDeviceMapper tInstitutionPersonDeviceMapper;

    /**
     * 查询机构或个人持有设备信息
     * 
     * @param releationId 机构或个人持有设备信息主键
     * @return 机构或个人持有设备信息
     */
    @Override
    public TInstitutionPersonDevice selectTInstitutionPersonDeviceByReleationId(String releationId)
    {
        return tInstitutionPersonDeviceMapper.selectTInstitutionPersonDeviceByReleationId(releationId);
    }

    /**
     * 查询机构或个人持有设备信息列表
     * 
     * @param tInstitutionPersonDevice 机构或个人持有设备信息
     * @return 机构或个人持有设备信息
     */
    @Override
    public List<TInstitutionPersonDevice> selectTInstitutionPersonDeviceList(TInstitutionPersonDevice tInstitutionPersonDevice)
    {
        return tInstitutionPersonDeviceMapper.selectTInstitutionPersonDeviceList(tInstitutionPersonDevice);
    }

    /**
     * 新增机构或个人持有设备信息
     * 
     * @param tInstitutionPersonDevice 机构或个人持有设备信息
     * @return 结果
     */
    @Override
    public int insertTInstitutionPersonDevice(TInstitutionPersonDevice tInstitutionPersonDevice)
    {
        tInstitutionPersonDevice.setCreateTime(DateUtils.getNowDate());
        return tInstitutionPersonDeviceMapper.insertTInstitutionPersonDevice(tInstitutionPersonDevice);
    }

    /**
     * 修改机构或个人持有设备信息
     * 
     * @param tInstitutionPersonDevice 机构或个人持有设备信息
     * @return 结果
     */
    @Override
    public int updateTInstitutionPersonDevice(TInstitutionPersonDevice tInstitutionPersonDevice)
    {
        tInstitutionPersonDevice.setUpdateTime(DateUtils.getNowDate());
        return tInstitutionPersonDeviceMapper.updateTInstitutionPersonDevice(tInstitutionPersonDevice);
    }

    /**
     * 批量删除机构或个人持有设备信息
     * 
     * @param releationIds 需要删除的机构或个人持有设备信息主键
     * @return 结果
     */
    @Override
    public int deleteTInstitutionPersonDeviceByReleationIds(String[] releationIds)
    {
        return tInstitutionPersonDeviceMapper.deleteTInstitutionPersonDeviceByReleationIds(releationIds);
    }

    /**
     * 删除机构或个人持有设备信息信息
     * 
     * @param releationId 机构或个人持有设备信息主键
     * @return 结果
     */
    @Override
    public int deleteTInstitutionPersonDeviceByReleationId(String releationId)
    {
        return tInstitutionPersonDeviceMapper.deleteTInstitutionPersonDeviceByReleationId(releationId);
    }
}
